const crypto = require('crypto');
const passwordHandler =function (password) {
    // const salt = crypto.randomBytes(16).toString('hex');
    // const hash = crypto.pbkdf2Sync(password, salt, 1000, 64, 'sha512').toString('hex');
    const md5 = crypto.createHash('md5');   // 创建一个md5对象    参数：md5, sha1, sha256, sha512
    return md5.update(password).digest('hex');
};
module.exports = passwordHandler;